import java.util.*;
import java.awt.*;
import java.io.*;

import javax.swing.JOptionPane;
import javax.xml.xpath.*;

import java.io.OutputStreamWriter;
import java.net.URL;
import java.net.URLConnection;
import java.util.Scanner;


public class GameType {

	int[][] BattleShipGrid = new int[10][10];
	Random gen = new Random();
	
	
	public static void main(String[] args) {
		
	}
	
	public static void CreateNewGame()
	{
		String newgame = JOptionPane.showInputDialog(null,
				"would you like to play a game?", "Yes or No",
				JOptionPane.QUESTION_MESSAGE);
		
		String player = JOptionPane.showInputDialog(null,
				"who would you like to play", "Edison, Geeves, Robby or Random", 
				JOptionPane.QUESTION_MESSAGE);
		if(newgame == "newgame"){
		//create the GUI
		CreateGUI();
		//null all variables
		ConnectToGame(player);
		}
		else{
			JOptionPane.showMessageDialog(null, "Have a nice day");
		}
	}
	
	public static void ConnectToGame(String secondPlayer)
	{
		//call server and GUI to connect to game
		//create players
		//allow the user to place ships, place storage in array
		
	}
	
	public static void PlaceShips(String shipName, String direction, int size, String row, String colomn)
	{
		String shipLocation = colomn.concat(row);
		//send the shipname, direction, size, shiplocation to server.
		
	}
	public static void CreateGUI()
	{
		//call GUI class
	}
	
	public static void Fire(String column, String row)
	{
		//create the fire method and make sure they only do it once
		String fireLocation = column.concat(row);
		
	}
	
	public static String CheckHitOrMiss(String hitOrMiss)
	{
		//check with the server if the target has been hit
		return hitOrMiss;
	}
	
	public static void Update()
	{
		//update all variables and arrays after actions
	}
	
	public static void ChangeTurn()
	{
		//rotate through players back and forth
		//use player names to go back and forth till condition ends game
	}
	
	public static void EndGame()
	{
		//ask GUI to output end game 
		//call this. simple end game
	}
}
